<% return if workshop.nil? or workshop.author.nil? %>

<li class="box-item workshop">
  <%= link_to(workshop) do %>
    <!-- corner -->
    <div class="corner-item">
      <div class="corner-item2">
        <div class="corner-color"></div>
        <i class='fa fa-book'></i>
      </div>
      <div class="corner-background"></div>
    </div>
    <!-- image/icon -->
    <div class="container-img">
      <div class="img-box">
        <%#= link_to raw(icon(workshop)), workshop, :title => workshop.title %>
        <%= raw(icon(workshop)) %>
      </div>
    </div>
  <%end%>
  <!-- INFO -->
  <div class="caption">
    <!-- Title -->
    <h6>
      <%= link_to workshop.title, workshop %>
    </h6>
    <!-- Author -->
    <div class="author">
      <span class="by"><%=t('by')%></span>
      <%= link_to truncate_name(workshop.author.name, length: 25), workshop.author.subject %>
    </div>
    <hr>
    <div class="info-bottom">
      <!--like -->
      <div class="like">
        <div class="count"><%=workshop.post_activity.likes.count.to_s%></div>
        <%= link_like(workshop.post_activity)%>
      </div>
      <!--views -->
      <div class="views">
        <%if workshop.private_scope? %>
          <div class="private-workshop-mark">
            <i class="fa fa-lock"></i>
          </div>
        <%else%>
          <%=workshop.visit_count.to_s%>
          <i class="fa fa-eye"></i>
        <%end%>
      </div>
    </div>
  </div>
</li>
